package cn.lili.modules.system.serviceimpl;

import cn.lili.modules.system.entity.dos.RegionQdd;
import cn.lili.modules.system.mapper.RegionQddMapper;
import cn.lili.modules.system.service.RegionQddService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class RegionQddServiceImpl extends ServiceImpl<RegionQddMapper, RegionQdd> implements RegionQddService {
    @Override
    public RegionQdd getRegionQdd(String code) {
        LambdaQueryWrapper<RegionQdd> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(RegionQdd::getCityCode, code);
        lambdaQueryWrapper.last("limit 1");
        return this.getOne(lambdaQueryWrapper);
    }
}
